#ifndef _VEHICLE
#define _VEHICLE

#include <chrono>
#include <cstdint>
#include <mavsdk/mavsdk.h>
#include <mavsdk/plugins/action/action.h>
#include <mavsdk/plugins/telemetry/telemetry.h>
#include <iostream>
#include <future>
#include <memory>

struct TelemetryLite {
public:
    TelemetryLite();
    void dump();
    std::string toJson();

public:
    uint64_t UniqueID;
    uint64_t TimeStamp;
    double Longitude;
    double Latitude;
    double PlatformHeight;
    double Yaw;
    double Pitch;
    double Roll;
    double VFov;
    double HFov;
    double FocalLength35mmEq;
    std::string ImgPath;
    std::string DateTime;  
};

class Vechile{
public:
    Vechile(char *connection_url);
    int arm();
    int takeoff();
	int disarm();
    int land();
    TelemetryLite& readTelemetry();

private:
    mavsdk::ConnectionResult connect(char *connection_url);

private:
    mavsdk::Mavsdk _mavsdk;
    mavsdk::ConnectionResult _connection_result;
    std::shared_ptr<mavsdk::System> _system;
    mavsdk::Telemetry _telemetry;
    mavsdk::Action _action;
    TelemetryLite _tl;
};

#endif
